feat: copy selected traces to other sections#97
Open
dustenhubbard wants to merge 1 commit into
Open
Conversation
Add a "Copy to sections..." action that copies the selected trace(s) onto other sections at the same field location. Each trace's field coordinates are re-projected through every target section's own inverse transform (computed once per section), so the traces land at the identical field x-y regardless of how each section is aligned. Sections with a non-invertible transform are skipped and reported rather than written to. Trace attributes are preserved and the source (current) section is left unchanged. Target sections are chosen by number or inclusive range in a small picker dialog; the parser validates tokens without materializing typed ranges (so a huge upper bound cannot hang the UI) and reports requested sections that do not exist instead of silently dropping them. The action is available at the field context-menu top level (next to Copy) and in the trace list. Includes tests for the parser and the data-model copy operation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Copying a trace only pastes it into the current section, so placing the same trace at the same location across many sections means navigating to each one and pasting. This adds a Copy to sections action: copy the selected trace(s), choose target sections (individual numbers and ranges, e.g.
10-20or5, 8, 11), and place them into all of those sections at the same field (x, y) location in one step.Approach
CopyToSectionsDialog(PyReconstruct/modules/gui/dialog/copy_to_sections.py) collects the target-section spec;parse_section_specaccepts individual numbers and ranges.Series.copyTracesToSectionsre-projects each trace's field points through each target section's transform, so the trace lands at the same field location regardless of that section's alignment.field_widget_2_trace.py,context_menu_list.py).Robustness
1-999999999) cannot hang the UI.tests/test_copy_traces_to_sections.py.Closes #94